package sgd.tp2.api.cmdline;

import sgd.tp2.api.net.CDRFormatType;

import com.beust.jcommander.IStringConverter;

public class CDRFormatConverter implements IStringConverter<CDRFormatType> {

	@Override
	public CDRFormatType convert(String value) {
		if (value.equalsIgnoreCase("JSON"))
			return CDRFormatType.JSON;
		if (value.equalsIgnoreCase("CSV"))
			return CDRFormatType.CSV;
		if (value.equalsIgnoreCase("Object"))
			return CDRFormatType.OBJECT;
		if (value.equalsIgnoreCase("Bytes"))
			return CDRFormatType.BYTES;
		return CDRFormatType.XML;
	}
}